﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.MiniQuest {
    import flash.events.*;
    import Display.DialogUI.*;
    import Display.*;
    import Classes.inventory.*;
    import Display.RenameUI.*;

    public class RequestItemMQ extends MiniQuest {

        public static const QUEST_NAME:String = "requestItemMQ";

        protected var m_itemsToWatch:Array;
        protected var m_hasBeenShown:Boolean;

        public function RequestItemMQ(){
            this.m_itemsToWatch = [RequestItemType.SIGNATURE];
            super(QUEST_NAME);
            this.m_hasBeenShown = false;
            m_recurrenceTime = 0;
        }
        public function get isQuestNeeded():Boolean{
            var _local1:String;
            if (!this.m_hasBeenShown){
                for each (_local1 in this.m_itemsToWatch) {
                    if (this.typeIsNeeded(_local1)){
                        return (true);
                    };
                };
            };
            return (false);
        }
        override protected function initQuest():void{
            if (((m_assetsLoaded) && (!(m_questActive)))){
                this.m_hasBeenShown = true;
            };
            super.initQuest();
        }
        protected function typeIsNeeded(_arg1:String):Boolean{
            switch (_arg1){
                case RequestItemType.SIGNATURE:
                    return ((Global.franchiseManager.getCompletedSignatureCount() > 0));
                default:
                    return (false);
            };
        }
        override protected function onIconClicked(_arg1:MouseEvent):void{
            super.onIconClicked(_arg1);
            var _local2:String = ZLoc.t("Dialogs", "RenameUI_message");
            var _local3:RenameDialog = new RenameDialog(_local2, "RenameUI", GenericDialogView.TYPE_OK, null, "RenameUI");
            Global.ui.renameDialog = _local3;
            UI.displayPopup(_local3);
        }

    }
}//package Classes.MiniQuest 
